import { DynamicModule, Module } from '@nestjs/common';
import { ExampleService } from './example.service';
import { ExampleController } from './example.controller';

@Module({
  controllers: [ExampleController],
  providers: [ExampleService]
})
export class ExampleModule {
  static register(options: Record<string, any>): DynamicModule {
    return {
      module: ExampleModule,
      controllers: [ ExampleController ],
      providers: [
        {
          provide: 'CONFIG_OPTIONS',
          useValue: options,
        },
        ExampleService
      ],
      exports: []
    }
  }
}
